Skip to content

feat: add memory debug mode and settings drawer - #105

Merged
kbuffardi merged 7 commits into
mainfrom
feature/issue-104-memory-debug-mode
Oct 9, 2026
Merged

kbuffardi merged 7 commits into
mainfrom
feature/issue-104-memory-debug-mode

Conversation

@kbuffardi

Copy link
Copy Markdown
Owner

Summary

  • Add an extension-wide Settings drawer with an auto-saving Memory Debug Mode toggle, defaulting to off.
  • Instrument every shared compile path with fatal UBSan checks and libc++ debug hardening when enabled.
  • Report supported failures with an error category and source location, preserve prior program output, and terminate nonzero.
  • Link the (?) help icon to Clang's official UBSan documentation in a protected new tab.
  • Prepare the updated minor release as 0.5.0.

Implementation

  • Store global settings separately from project/session state in chrome.storage.local / browser.storage.local.
  • Snapshot memoryDebugMode into the shared compile payload used by toolbar actions, shortcuts, and terminal g++ / clang++ commands.
  • Apply -fsanitize=undefined, fatal recovery behavior, debug information, and libc++ debug hardening centrally in the compiler worker.
  • Supply the missing WASI UBSan reporting runtime through explicit WebAssembly imports, decoding Clang source metadata in the worker.
  • Validate the finished module against an explicit UBSan-handler allowlist so --allow-undefined cannot conceal ordinary unresolved user symbols.
  • Extend Node, real-toolchain, and Chromium smoke coverage; document behavior and limitations in the README and reviewed plan.

Scope and limitations

The bundled wasm32-wasi Clang target rejects AddressSanitizer. Memory Debug Mode therefore provides the confirmed combination of UBSan and hardened libc++ checks, not comprehensive ASan heap-overflow or use-after-free detection. Generic RuntimeError: unreachable output is not used as the accepted diagnostic for supported UBSan failures.

Validation

  • npm ci
  • npm run lint
  • npm run build
  • npm run test:e2e — 216 passed
  • npm run test:e2e:compiler — 7 passed against the bundled Clang/LLD/WASI toolchain
  • npm run test:browser:chrome / direct Chrome smoke — Settings UI, persistence, protected help link, and compile/run fallback passed
  • npm run version:check
  • npm run release:check-version
  • npm run package:release — produced the 0.5.0 Chromium-family archive and checksums

npm audit --audit-level=high reports the repository's existing dependency-graph findings (2 moderate, 13 high). This PR changes no dependency versions; resolving the findings—some of which require breaking build-tool upgrades—is intentionally kept out of Issue #104.

Closes #104

Instrument opt-in builds with fatal UBSan checks and libc++ debug hardening. Supply source-aware UBSan handlers through validated WebAssembly imports so undefined user symbols still fail compilation.\n\nRefs #104
Add a top-right Settings drawer with an auto-saving extension-wide Memory Debug Mode toggle and official UBSan help link. Snapshot the setting into every shared compile payload so toolbar, shortcuts, and terminal builds use the same mode.\n\nRefs #104
@kbuffardi
kbuffardi merged commit 064c38c into main Oct 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: runtime memory errors

1 participant